package com.weijian.dal.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public abstract class BaseDO implements Serializable {
    @TableField(
            fill = FieldFill.INSERT
    )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @TableField(
            fill = FieldFill.INSERT_UPDATE
    )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    @TableField(
            fill = FieldFill.INSERT,
            jdbcType = JdbcType.VARCHAR
    )
    private String creator;
    @TableField(
            fill = FieldFill.INSERT_UPDATE,
            jdbcType = JdbcType.VARCHAR
    )
    private String updater;
    @TableLogic(value = "FALSE", delval = "TRUE")
    private Boolean deleted;

}